package njust.csc.aecore.extension

import soot.jimple.infoflow.android.manifest.ProcessManifest

/**
 * @Author ZhouHang
 * @Date 24/5/29 周三
 */
fun ProcessManifest.compileSdkVersion(): Int {
    val attr = manifest.getAttribute("compileSdkVersion")
    return attr?.asInteger(this.arscParser) ?: -1
}

fun ProcessManifest.applicationName(): String {
    val application = manifest.getChildrenWithTag("application")[0]
    val attr = application.getAttribute("label")
    return attr?.asString(this.arscParser) ?: ""
}

fun ProcessManifest.icon(): String {
    val application = manifest.getChildrenWithTag("application")[0]
    val attr = application.getAttribute("icon")
    return attr?.asString(this.arscParser) ?: ""
}